package com.example.demo.mapper;

import com.example.demo.bean.Drink;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

@Repository
public interface DrinkMapper {


    int add(Drink drink);

    int delete(Drink drink);

    int update(Drink drink);


    /**
     * 根据饮料名查询
     * @param drinkName
     * @return
     * @author kongjiawei
     * @date 2021/9/5 17:21
     */

    List<Drink> query(@Param("drinkName") String  drinkName);

    @Select("select drinkname from drink where is_delete=0")
    Set<String> queryName();

    String queryByName(String name);

    @Select("select drinkname,price from drink")
    List<Drink> queryDrinkName();

}
